package ca.kooki.codesnippet;

import junit.framework.Assert;

import org.junit.Test;

public class InMemoryCodeSnippetRepositoryTest extends CodeSnippetRepositoryTest {

  @Override
  public CodeSnippetRepository newRepository() 
  {
    return new InMemoryCodeSnippetRepository();
  }
  
  @Test
  public void RequiredForRunner()
  {}

  @Test
  public void Default()
  {
    Assert.assertSame(InMemoryCodeSnippetRepository.getDefault(), InMemoryCodeSnippetRepository.getDefault());
  }
  
  @Test
  public void Reset()
  {
    InMemoryCodeSnippetRepository.getDefault().addCodeSnippet(new CodeSnippet("t","k","c"));
    Assert.assertEquals(1, InMemoryCodeSnippetRepository.getDefault().getAllSnippets().length);
    InMemoryCodeSnippetRepository.resetDefault();
    Assert.assertEquals(0, InMemoryCodeSnippetRepository.getDefault().getAllSnippets().length);
    
  }
}
